Getting started with the SDK
Some .NET C# code examples are provided to demonstrate the capabilities of the .NET Blueprint SDK, available as part of the Action Object Toolkit.
See also the complete reference of the Objects and Methods available in this help file.
Setting up Visual Studio
The code examples provided have been produced in Microsoft Visual Studio.
When setting up your Visual Studio project, the following project configuration must be applied:
-
Add the Action Object Toolkit SDK dll's as assembly references to your project. The SDK dll’s can be found in the Proficy CSense installation folder.
-
Proficy.CSense.SDK.dll
-
Proficy.CSense.SDK.Base.dll
-
Proficy.CSense.SDK.Blocks.dll
-
Proficy.CSense.SDK.Runtime
-
-
Set the "Copy Local" option to false on all assemblies referred to above.
-
Ensure that your source code is “using” the Proficy.CSense.SDK and Proficy.CSense.SDK.Blocks namespaces.
NOTE: This information is typically added as a “using Proficy.CSense.SDK;” block at the top of your source file. -
Set your the "Platform Target" to x86. Ensure that it is NOT set to “Any CPU”.
-
Add an app.config file to your project with the contents provided in the following section.
App.Config file contents
Add an app.config file to your project and merge the existing file contents with the following:
XML: |
<?xml version="1.0"?> |
Deployment considerations
The following deployment scenarios should be considered for custom applications that make use of the Action Object Toolkit .
- Basic: If your application is a single executable it can simply be placed in the CSense installation directory. Using the default CSense installation options this will be: <C:\Program Files (x86)\Proficy\Proficy CSense>.
- Advanced: If your application has its own installer or is required to be in a separate location you must use, and implement a custom assembly resolver in your application. This is needed to redirect assembly resolving so that assemblies can be loaded from the CSense installation directory. Copying Action Object Toolkit assemblies to other locations is not supported. The "Copy Local" option must be set to false on the Action Object Toolkit assembly references. A C# example of how to implement a custom assembly resolver is shown bellow, assuming that CSense is installed in the default location <C:\Program Files (x86)\Proficy\Proficy CSense>.
C#: |
using Proficy.CSense.SDK; { static Assembly AssemblyResolver(Object sender, ResolveEventArgs args) return null; static void Main(string[] args) static void RunProgram(string[] args)
|
Related topics: